package com.mobbanana.gameHelper;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

import java.io.IOException;
import java.io.InputStream;

public class AssetsResourceUtils {
    public static Bitmap getAssetsBitmap(Context context, String fileName) {
        try {
            InputStream inputStream = context.getAssets().open(fileName);
            Bitmap bitmap = BitmapFactory.decodeStream(inputStream);
            return bitmap;
        } catch (IOException e) {
            LogUtil.e( "[-] !!! Assets File Not Found : "+fileName);
            e.printStackTrace();
        }
        return null;
    }

    public static String getAssetsToString(Context context,String fileName) throws Exception {
        InputStream inputStream = context.getAssets().open(fileName);
        return FileUtils.readFileToString(inputStream);
    }
}
